package com.example.fastshare;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.QuickContactBadge;
import android.widget.TextView;

public class ListItem extends LinearLayout {
	QuickContactBadge avatar;
	TextView content;
	ImageView image;
	TextView time;
	public ListItem(Context context, boolean isReceived) {
		super(context);
		//isReceived = true => right
		//isReceived = false => left
		
		if (isReceived) {
			LayoutInflater listItem = (LayoutInflater) this.getContext()
					.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			listItem.inflate(R.layout.list_item_right, this, true);
		}
		else {
			LayoutInflater listItem = (LayoutInflater) this.getContext()
					.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			listItem.inflate(R.layout.list_item_left, this, true);
		}
		this.avatar = (QuickContactBadge)findViewById(R.id.avatar);
		this.content = (TextView) findViewById(R.id.lastMsg);
		this.image = (ImageView) findViewById(R.id.image);
		this.time = (TextView) findViewById(R.id.time);
		
	}
}
